// 应用配置
export const config = {
  // API 配置
  api: {
    // 用户服务 API
    userBaseURL: import.meta.env.VITE_USER_API_BASE_URL || 'http://localhost:8081',
    // 消息服务 API  
    messageBaseURL: import.meta.env.VITE_MESSAGE_API_BASE_URL || 'http://localhost:8082',
    timeout: 10000,
  },
  
  // WebSocket 配置（消息服务）
  websocket: {
    url: import.meta.env.VITE_WS_URL || 'ws://localhost:8082/ws',
    reconnectInterval: 3000,
    maxReconnectAttempts: 5,
  },
  
  // RSocket 配置（消息服务的 RSocket 端口）
  rsocket: {
    url: import.meta.env.VITE_RSOCKET_URL || 'ws://localhost:7002',
    keepAlive: 60000,
    lifetime: 180000,
    dataMimeType: 'application/json',
    metadataMimeType: 'message/x.rsocket.routing.v0',
  },
  
  // 应用配置
  app: {
    name: 'ReactIM H5',
    version: '1.0.0',
    maxFileSize: 10 * 1024 * 1024, // 10MB
    supportedImageTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
    supportedFileTypes: ['application/pdf', 'text/plain', 'application/msword'],
  },
  
  // UI 配置
  ui: {
    messagePageSize: 20,
    conversationPageSize: 50,
    typingTimeout: 3000,
    theme: {
      primary: '#409EFF',
      success: '#67C23A',
      warning: '#E6A23C',
      danger: '#F56C6C',
      info: '#909399',
    },
  },
}

export default config